import { Node } from '@antv/x6'
import { ShapeName } from './node/types'

export interface GraphNode {
  name: string
  title: string
  props: Node.Metadata
}
export interface AIGroup {
  name: string
  child: GraphNode[]
}
export const defaultGroup: AIGroup[] = [
  {
    name: 'I/O组件',
    child: [
      {
        name: ShapeName.VALUE_INPUT,
        title: '输入',
        props: {
          shape: ShapeName.VALUE_INPUT
        }
      },
      {
        name: ShapeName.FILE_LOADER,
        title: '加载网盘文件',
        props: {
          shape: ShapeName.FILE_LOADER
        }
      },
      {
        name: ShapeName.VALUE_OUTPUT,
        title: '输出',
        props: {
          shape: ShapeName.VALUE_OUTPUT
        }
      }
    ]
  },
  {
    name:'逻辑分支',
    child: [
      {
        name: ShapeName.IF_ELSE,
        title: '逻辑IF',
        props: {
          shape: ShapeName.IF_ELSE
        }
      },
      {
        name: ShapeName.FILE_TYPE,
        title: '文件分类',
        props: {
          shape: ShapeName.FILE_TYPE
        }
      }
    ]
  },
  {
    name: 'AI组件',
    child: [
      {
        name: ShapeName.LLM_EXEC,
        title: 'LLM调用',
        props: {
          shape: ShapeName.LLM_EXEC
        }
      },
      {
        name: ShapeName.INTENTION,
        title: '意图分析',
        props: {
          shape: ShapeName.INTENTION
        }
      },
      {
        name: ShapeName.MARKING_TAG,
        title: '实体解析',
        props: {
          shape: ShapeName.MARKING_TAG
        }
      },
      {
        name: ShapeName.SCORING,
        title: '智能评分',
        props: {
          shape: ShapeName.SCORING
        }
      },
      {
        name: ShapeName.CONTENT_CLASSIFY,
        title: '文件分类',
        props: {
          shape: ShapeName.CONTENT_CLASSIFY
        }
      },
      {
        name: ShapeName.TEXT_CHUNK,
        title: '文档解析',
        props: {
          shape: ShapeName.TEXT_CHUNK
        }
      }
    ]
  },
  {
    name: '数据源组件',
    child: [
      {
        name: ShapeName.DATABASE_QDRANT,
        title: 'Qdrant库',
        props: {
          shape: ShapeName.DATABASE_QDRANT
        }
      },
      {
        name: ShapeName.QUERY_QDRANT,
        title: '查询Qdrant',
        props: {
          shape: ShapeName.QUERY_QDRANT
        }
      },
      {
        name: ShapeName.SAVE_2ES,
        title: '保存到ES',
        props: {
          shape: ShapeName.SAVE_2ES
        }
      },
      {
        name: ShapeName.QUERY_2ES,
        title: '从ES查询',
        props: {
          shape: ShapeName.QUERY_2ES
        }
      }
    ]
  },
  {
    name: '拓展工具',
    child: [
      {
        name: ShapeName.UPLOAD_FILE2AI,
        title: '文件上传到AI',
        props: {
          shape: ShapeName.UPLOAD_FILE2AI
        }
      },
      {
        name: ShapeName.DOCUMENT_TRANSFORM,
        title: '文档转换',
        props: {
          shape: ShapeName.DOCUMENT_TRANSFORM
        }
      },
      {
        name: ShapeName.MULTIMODAL,
        title: '多模态转换',
        props: {
          shape: ShapeName.MULTIMODAL
        }
      },
      {
        name: ShapeName.RANDOM_NODE,
        title: '随机文本',
        props: {
          shape: ShapeName.RANDOM_NODE
        }
      },
      {
        name: ShapeName.CONSTANT,
        title: '常量节点',
        props: {
          shape: ShapeName.CONSTANT
        }
      }
    ]
  }
]
